﻿using FluentNHibernate.Mapping;
using YunBox2.Contracts.FoundationModels;

namespace YunBox2.DAL.Maps
{
    public class CurrencyMap : ClassMap<Currency>
    {
        public CurrencyMap()
        {
            Id(x => x.Id).GeneratedBy.Guid().Default("(newid())");
            Map(x => x.Name).Length(64).Not.Nullable();
            Map(x => x.ShortName).Length(6).Not.Nullable();
            Map(x => x.Symbol).Length(6).Not.Nullable();
            Map(x => x.IsDisable).CustomSqlType("bit").Not.Nullable().Default("(0)");
            Map(x => x.LastModifiedTime).Not.Nullable();
            References(x => x.LastModifiedUser).Column("LastModifiedUserID").Not.Nullable();
            Table("Currency");
        }
    }
}